<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>

<script>
window.onload=function()
{
		var oUl = document.getElementById('ul1');
	
		//oUl.firstChild.style.background ='red';  ie 6-8
	if(oUl.firstElementChild)
	{
			oUl.firstElementChild.style.background = 'red';
	}else
	{
			oUl.firstChild.style.background ='red';
	}
};
</script>
</head>

<body>
<ul id="ul1">
	<li>1</li>
	<li>2</li>
	<li>3</li>
</ul>
</body>
</html>
